<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
                           http://www.springframework.org/schema/beans/spring-beans.xsd
                           http://www.springframework.org/schema/context 
                           http://www.springframework.org/schema/context/spring-context.xsd">


	<bean id="hibernateSessionFactory"
		class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
		<!-- Es wird die obere Instanz eingeschleust -->
		<property name="dataSource" ref="dataSource" />
		<property name="annotatedClasses">
			<list>
				<value>de.cms.kff.model.Auto</value>
				<value>de.cms.kff.model.Verleih</value>
				<value>de.cms.kff.model.Mitarbeiter</value>
			</list>
		</property>
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
				<prop key="hibernate.hbm2ddl.auto">update</prop>
				<prop key="hibernate.show_sql">true</prop>
				<prop key="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</prop>
			</props>
		</property>
	</bean>
	
	<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
		<property name="sessionFactory" ref="hibernateSessionFactory" />
	</bean>
	
	<!-- ******************* -->
	<!-- Data Access Objects -->
	<!-- ******************* -->
	
	<bean id="mitarbeiterDao" class="de.cms.kff.dao.MitarbeiterDao">
		<property name="sessionFactory" ref="hibernateSessionFactory" />
	</bean>
	
	<bean id="verleihDao" class="de.cms.kff.dao.VerleihDao">
		<property name="sessionFactory" ref="hibernateSessionFactory" />
	</bean>

	<bean id="autoDao" class="de.cms.kff.dao.AutoDao">
		<property name="sessionFactory" ref="hibernateSessionFactory" />
		<property name="verleihDao" ref="verleihDao"/>
	</bean>
</beans>